package com.example.book.sys.user.service;

import com.example.book.base.BaseService;
import com.example.book.sys.user.dao.SysUserRoleDao;
import com.example.book.domain.sys.SysUserRole;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author haocj
 * 角色权限service
 */
@Service
public class SysUserRoleService extends BaseService<SysUserRole, SysUserRoleDao> {

    @Resource
    private SysUserRoleDao sysUserRoleDao;

    @Transactional(readOnly = false,rollbackFor = Exception.class)
    public void deleteById(String rid) {
        sysUserRoleDao.deleteById(rid);
    }

    /**
     * 批量新增
     * @param list
     */
    @Transactional(readOnly = false,rollbackFor = Exception.class)
    public void save(List<SysUserRole> list) {
        sysUserRoleDao.save(list);
    }

    /**
     * 根据id查询集合
     * @param id
     * @return
     */
    public List<SysUserRole> findList(String id) {
        return sysUserRoleDao.findList(id);
    }
}
